package com.hd.openapi.web.cotenollen;

import com.hd.openapi.common.ResponseResult;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.entity.AppInfo;
import com.hd.openapi.entity.Customer;
import com.hd.openapi.servies.infoser;
import com.hd.openapi.servies.rechargeser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/info")
public class infoconll {
    @Autowired
    private infoser ser;
    @Autowired
    private rechargeser rs;

    @RequestMapping("/table")
    public ResultTable table(Integer page,Integer limit,String corpName){
        return ser.getdata(page,limit,corpName);
    }
    @RequestMapping("/add")
    private ResponseResult add(AppInfo appInfo){
        return ser.addtata(appInfo);
    }
    @RequestMapping("/update")
    private ResponseResult update(AppInfo appInfo){
        return ser.updateda(appInfo);
    }
    @RequestMapping("/del")
    private ResponseResult del(Integer[] ids){
        return ser.del(ids);
    }
    @RequestMapping("/tree")
    public List<Customer> sta(){
        return rs.getall ();
    }
}
